import type {
  IPanelItemProvider,
  PanelController,
  PanelItemController,
} from "@ibiz-template/runtime";
import type { IPanelCtrlPos } from "@ibiz/model-core";
import { PanelCtrlPosController } from "./i-biz-panel-ctrl-pos.controller";

/**
 * 面板控件占位适配器
 *
 * @export
 * @class PanelCtrlPosProvider
 * @implements {IPanelItemProvider}
 */
export class PanelCtrlPosProvider implements IPanelItemProvider {
  component: string = "IBizPanelCtrlPos";

  async createController(
    panelItem: IPanelCtrlPos,
    panel: PanelController,
    parent: PanelItemController | undefined
  ): Promise<PanelCtrlPosController> {
    const c = new PanelCtrlPosController(panelItem, panel, parent);
    await c.init();
    return c;
  }
}
